import request from './request';

export default (file: File, params: any) => {
  const formData = new FormData();
  formData.append('file', file);
  Object.keys(params).forEach(key => {
    formData.append(key, params[key]);
  });

  return request.post('/v1/file/upload', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};
